﻿namespace Agile.Infra.Core.Agile.ViewModel;

/// <summary>
/// 通用分页信息类
/// </summary>
public class PageModel<T>
{
    /// <summary>
    /// 当前页标
    /// </summary>
    public int PageIndex { get; set; } = 1;
    /// <summary>
    /// 每页大小
    /// </summary>
    public int PageSize { set; get; } = 20;
    /// <summary>
    /// 总页数
    /// </summary>
    public int PageCount { get { return TotalCount % PageSize == 0 ? TotalCount / PageSize : TotalCount / PageSize + 1; } }
    /// <summary>
    /// 总记录数
    /// </summary>
    public int TotalCount { get; set; } = 0;  
    /// <summary>
    /// 返回数据
    /// </summary>
    public List<T> Data { get; set; }
}
